package code14JDBC.练习;

import code14JDBC.Emp;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 黄衡熙
 * @version 1.0
 */
public class Class {
    private Integer id;
    private String class_no;
    private String major;
    private List<Student> students = new ArrayList<>();
    public void addStudent(Student student) {
        students.add(student);
    }
    public List<Student> getStudent() {
        return students;
    }

    public void setStudent(List<Student> student) {
        this.students = student;
    }

    public Class() {
    }

    public Class(Integer id) {
        this.id = id;
    }

    public Class(String class_no, String major) {
        this.class_no = class_no;
        this.major = major;
    }

    @Override
    public String toString() {
        return "Class{" +
                "id=" + id +
                ", class_no='" + class_no + '\'' +
                ", major='" + major + '\'' +
                ", students=" + students +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getClass_no() {
        return class_no;
    }

    public void setClass_no(String class_no) {
        this.class_no = class_no;
    }

    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }
}
